home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group01b.txt
/
000043_icon-group-sender_Fri Mar 2 17:07:52 2001.msg
< prev
next >
Wrap
Internet Message Format
|
2002-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f2307Q626330
for icon-group-addresses; Fri, 2 Mar 2001 17:07:26 -0700 (MST)
Message-Id: <200103030007.f2307Q626330@baskerville.CS.Arizona.EDU>
Date: Fri, 02 Mar 2001 15:16:32 -0600
From: gep2@terabites.com
Subject: Re: New Scientist puzzle
To: memoryalpha@juno.com, ardler@argonet.co.uk, icon-group@cs.arizona.edu
Cc: gep2@terabites.com, Steve_Graham@labcorp.com, NLiber@wmsgaming.com,
cary@cup.hp.com
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1410
That one is VERY elegant, Steve. Nice!! I really like the use of the csets...
a good example of Icon expressiveness at work.
It would be interesting to see if the people offering New Scientist solutions in
"those other" programming languages get the hint that S*BOL and Icon might be
worth looking into. ;-) Does anybody know if the magazine is going to publish
the prettiest solutions?
On Fri, 2 Mar 2001, memoryalpha@juno.com wrote:
># Bob: Here's a (non-PDF'ed) variant of the file I sent you on 28 Feb:
>
>procedure main() # Written by Steve Hunter 1 March 2000
>
># All 4 digits distinct? push onto v-list;
># 3 of the 4 digits distinct, with first-digit = last-digit? push onto
>n-list:
>v_l := []; n_l := []
>every s := string((32 to 99)^2) do
> push(case *cset(s) of {4: v_l; (s[1]==s[-1], 3): n_l}, s)
>
>v_t := table(); n_t := table()
>every (*((v:=!v_l) ++ (n:=!n_l)) = 6, v[-2] == n[2]) do {
> /v_t[v] := set(); insert(v_t[v], n)
> /n_t[n] := set(); insert(n_t[n], v)
>}
>
># Only print the 1-to-1 pairing(s)
>every 1 = *(n_ms := v_t[v:=key(v_t)]) = *n_t[n:=!n_ms] do write(v, ", ",
>n)
>end
Gordon Peterson http://personal.terabites.com/
Support the Anti-SPAM Amendment! Join at http://www.cauce.org/
12/19/98: Partisan Republicans scornfully ignore the voters they "represent".
12/09/00: the date the Republican Party took down democracy in America.